<?php
/* 
    Project     : 48c6c450f1a4a0cc53d9585dc0fee742
    Created on  : Mar 16, 2013, 11:29:15 PM
    Author      : Truong Khuong - khuongxuantruong@gmail.com
    Description :
        Purpose of the stylesheet follows.
*/
class base_model extends backend_model {
    function __construct($table='',$prefix='')
    {
        parent::__construct($table,$prefix);
        
    }
//    function _get($id){
//        $query=$this->db
//                ->where($this->prefix.'_id',$id)
//                ->get($this->table);
//        return $query->row();
//    }
//    
//    function _gets($types=null){
//        if($types){
//            if(!is_array($types))$types=array($types);
//            $this->db->where($this->prefix.'_type',$types);
//        }
//        $query=$this->db
//                ->from($this->table)
//                ->order_by($this->prefix.'_insert','DESC')
//                ->get(); 
//        return $query->result();
//    }
//    function _insert($params){
//        $this->db->set($this->prefix.'_insert', 'NOW()', FALSE);
//        @$this->db->insert($this->table, $params); 
//        @$count = $this->db->affected_rows(); //should return the number of rows affected by the last query
//        if($count==1) return true;
//        return false;
//    }
//    function _delete($id){
//        $this->db->set($this->prefix.'_delete', 'NOW()', FALSE);
//        $where=array($this->prefix.'_id'=>$id);
//        $this->db->where($where);
//        $this->db->update($this->table); 
//        $count = $this->db->affected_rows(); //should return the number of rows affected by the last query
//        if($count==1) return true;
//        return false;
//    }
//    function _retore($id){
//        $this->db->set($this->prefix.'_delete', 'NULL', FALSE);
//        $where=array($this->prefix.'_id'=>$id);
//        $this->db->where($where);
//        $this->db->update($this->table); 
//        $count = $this->db->affected_rows(); //should return the number of rows affected by the last query
//        if($count==1) return true;
//        return false;
//    }
//    function _update($id,$params){
//        $this->db->set($this->prefix.'_update', 'NOW()', FALSE);
//        $this->db->where($this->prefix.'_id', $id);
//        @$this->db->update($this->table, $params); 
//        @$count = $this->db->affected_rows(); //should return the number of rows affected by the last query
//        if($count==1) return true;
//        return false;
//    }
    
}
?>
